package project.mainstart;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
//@SpringBootApplication is a convenience annotation that adds all of the following:




//1.@ComponentScan()
/* set the Spring to find out all classes which are either directly or indirectly annotated with 
* @Component. Spring adds these classes in Application context which can be used later for Dependency Injection (IoC).
* */
//2.@EnableAutoConfiguration
/*sets the Spring to search application dependencies in project and try to manage things accordingly.
*As we have tomcat starter related dependencies in our project so Spring will deploy our application
*in tomcat server it self with default configurations.
**/
/*3.Normally you would add @EnableWebMvc for a Spring MVC app, but Spring Boot adds it automatically 
* when it sees spring-webmvc on the classpath. 
* This flags the application as a web application and activates key behaviors such as setting up a DispatcherServlet.
* */
@SpringBootApplication(scanBasePackages={"project"})
//make annotation in scanBasePackages attribute to specify the packages for scanning
@EnableAutoConfiguration
public class MainStart {

	public static void main(String[] args) {
//		this is xml(maven)style
//		ConfigurableApplicationContext context = SpringApplication.run(new Object[]{MainStart.class,"inventory.xml"}, args);
//
		SpringApplication.run(MainStart.class, args);
		
		System.out.println("Scaffolding of Spring MVC + Hibernate Framework is Done");
	}

}
